<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>注册</h2>
    邮箱： <input type="text" id="user"><br>
    密码： <input type="text" id="pass"><br>
    <input type="text"><button>发送邮箱验证码</button><br>
    <button id="but">注册</button>

</body>

</html>
<script src="./ObjectAjax.js"></script>
<script>
    let common = new PublicUser()
    let $ = common.$
    $("#but").onclick = e => {
        common.post({
            url: "/zhu",
            text: {
                user: common.$("#user").value,
                pass: common.$("#pass").value,
            },
            hed : {},
            callback(str){
                console.log(str);
                str = JSON.parse(str)
                if(str.type === "001"){
                    location.href = "http://localhost:3000/hom.html"
                }
            }

        })
    }

</script>